<#macro menu>
<aside class="main-sidebar">
	<section class="sidebar">
		<ul class="sidebar-menu">
			<li class="header">主导航</li>
			<#list list as item>
			<#if item.type == 'directory' && item.url == '' && item.id != 1>
            <li class="treeview">
                <a href="#">
                    <i class="fa <#if (item.fontIco??) && item.fontIco != ''>${item.fontIco}<#else>fa-envelope</#if>"></i>
                    <span>${item.name!}</span>
                    <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i></span>
                </a>
                <ul class="treeview-menu">
					<#list list as menu>
					<#if menu.parentId == item.id?string>
					<li>
						<a target="navTab" href="${menu.url!}">
							<i class="fa <#if (menu.fontIco??) && menu.fontIco != ''>${menu.fontIco}<#else>fa-inbox</#if>"></i>
							<span>${menu.name!}</span>
						</a>
					</li>
					</#if>
					</#list>
                </ul>
            </li>
			</#if>
			<#if item.type == 'directory' && item.url != ''>
                <li>
                    <a target="navTab" href="${item.url!}">
                        <i class="fa <#if (item.fontIco??) && item.fontIco != ''>${item.fontIco}<#else>fa-envelope</#if>"></i> <span>${item.name!}</span> </i>
                    </a>
                </li>
			</#if>
			</#list>
		</ul>
	</section>
</aside>
</#macro>

<#macro header>
<header class="main-header">
	<a href="index2.html" class="logo">
		<span class="logo-mini"><b>A</b><b>T</b></span>
		<span class="logo-lg"><b>Admin</b>LTE</span>
	</a>
	<nav class="navbar navbar-static-top">
		<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
			<span class="sr-only">切换导航</span>
		</a>
		<div class="navbar-custom-menu">
			<ul class="nav navbar-nav">
				<li class="dropdown user user-menu">
					<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown">
						<img src="dist/img/user2-160x160.jpg" class="user-image" alt="User Image"> <span class="hidden-xs">${bean.username!}</span>
					</a>
					<ul class="dropdown-menu">
						<li class="user-header">
							<img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
							<p>
								<small>欢迎登录，${bean.username!}</small>
							</p>
						</li>
						<li class="user-body">
							<div class="row">
								<div class="col-xs-12 text-center">
                                    <a href="#" data-skin="skin-blue" class="btn btn-primary btn-xs"><i class="fa fa-eye"></i></a>
                                    <a href="#" data-skin="skin-blue-light" class="btn btn-primary btn-xs"><i class="fa fa-eye"></i></a>
                                    <a href="#" data-skin="skin-yellow" class="btn btn-warning btn-xs"><i class="fa fa-eye"></i></a>
                                    <a href="#" data-skin="skin-yellow-light" class="btn btn-warning btn-xs"><i class="fa fa-eye"></i></a>
                                    <a href="#" data-skin="skin-green" class="btn btn-success btn-xs"><i class="fa fa-eye"></i></a>
                                    <a href="#" data-skin="skin-green-light" class="btn btn-success btn-xs"><i class="fa fa-eye"></i></a>
                                    <a href="#" data-skin="skin-purple" class="btn bg-purple btn-xs"><i class="fa fa-eye"></i></a>
                                    <a href="#" data-skin="skin-purple-light" class="btn bg-purple btn-xs"><i class="fa fa-eye"></i></a>
								</div>
							</div>
						</li>
						<li class="user-footer">
							<div class="pull-left">
								<a href="/admin/user/editpwd" target="modal" modal="lg" class="btn btn-default btn-flat">密码修改</a>
							</div>
							<div class="pull-right">
								<a href="/admin/logout" class="btn btn-default btn-flat">安全退出</a>
							</div>
						</li>
					</ul>
				</li>
				<#--<li>
					<a href="#" data-toggle="control-sidebar">
						<i class="fa fa-gears"></i>
					</a>
				</li>-->
			</ul>
		</div>
	</nav>
</header>
</#macro>

<#macro footer>
	<footer class="main-footer">
		<strong>Copyright &copy; 2014-2099</strong> All rights reserved.
	</footer>
</#macro>

<#macro style>
	<!-- Tell the browser to be responsive to screen width -->
	<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
	<link rel="shortcut icon" type="image/x-icon" href="/dist/img/favicon.ico">
	<!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="plugins/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="dist/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="dist/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
	<!-- 以上为公共css -->
	
	<!-- daterange picker -->
	<link rel="stylesheet" href="plugins/datepicker/datepicker3.css">
    <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker.css">
    <!-- bootstrap datepicker -->
    <link rel="stylesheet" href="plugins/datetimepicker/bootstrap-datetimepicker.css">
    <!-- iCheck for checkboxes and radio inputs -->
    <link rel="stylesheet" href="plugins/iCheck/all.css">
    <!-- Bootstrap Color Picker -->
    <link rel="stylesheet" href="plugins/colorpicker/bootstrap-colorpicker.min.css">
    <!-- Bootstrap time Picker -->
    <link rel="stylesheet" href="plugins/timepicker/bootstrap-timepicker.min.css">
    <!-- Select2 -->
    <link rel="stylesheet" href="plugins/select2/select2.min.css">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="plugins/iCheck/flat/blue.css">

    <!-- fullCalendar 2.2.5-->
    <link rel="stylesheet" href="plugins/fullcalendar/fullcalendar.min.css">
    <link rel="stylesheet" href="plugins/fullcalendar/fullcalendar.print.css" media="print">

    <!-- Ion Slider -->
    <link rel="stylesheet" href="plugins/ionslider/ion.rangeSlider.css">
    <!-- ion slider Nice -->
    <link rel="stylesheet" href="plugins/ionslider/ion.rangeSlider.skinNice.css">
    <!-- bootstrap slider -->
    <link rel="stylesheet" href="plugins/bootstrap-slider/slider.css">

    <!-- Morris chart -->
    <link rel="stylesheet" href="plugins/morris/morris.css">
    <!-- jvectormap -->
    <link rel="stylesheet" href="plugins/jvectormap/jquery-jvectormap-1.2.2.css">

	<link rel="stylesheet" href="plugins/bootstrap-fileinput/fileinput.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<script>
		function onClickCheckbox(clickName, target){
			var status = false;
			if(document.getElementById(clickName).checked){
				status = true;
			}
			var list = document.getElementsByName(target);
			for(var i=0;i<list.length;i++){
				list[i].checked=status;
			}
		}
		
		function iFrameHeight() { 
			var ifm= document.getElementById("content"); 
			var subWeb = document.frames ? document.frames["content"].document : ifm.contentDocument; 
			if(ifm != null && subWeb != null) { 
			ifm.height = subWeb.body.scrollHeight; 
			} 
		} 
	</script>
	<style>
        .fixed.ajax-template .content{
            margin-top:0px !important;
		}
	</style>
</#macro>

<#macro jsFile>
	<!-- jQuery 2.2.3 -->
<script src="plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="plugins/fastclick/fastclick.js"></script>
<!-- Slimscroll -->
<script src="plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/app.js"></script>
<!-- 以上JS为页面必须 -->
   
<!-- jQuery UI 1.11.4 -->
<script src="plugins/jQueryUI/jquery-ui.min.js"></script>
<!-- Morris.js charts -->
<script src="plugins/raphael/raphael.min.js"></script>
<script src="plugins/morris/morris.min.js"></script>
<!-- Sparkline -->
<script src="plugins/sparkline/jquery.sparkline.min.js"></script>
<!-- jvectormap -->
<script src="plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<!-- jQuery Knob Chart -->
<script src="plugins/knob/jquery.knob.js"></script>
<!-- daterangepicker -->
<script src="plugins/moment/moment.min.js"></script>
<script src="plugins/daterangepicker/daterangepicker.js"></script>
<!-- datepicker -->
<script src="plugins/datetimepicker/bootstrap-datetimepicker.js"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<!-- SlimScroll 1.3.0 -->
<script src="plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- ChartJS 1.0.1 -->
<script src="plugins/chartjs/Chart.min.js"></script>
<!-- FLOT CHARTS -->
<script src="plugins/flot/jquery.flot.min.js"></script>
<!-- FLOT RESIZE PLUGIN - allows the chart to redraw when the window is resized -->
<script src="plugins/flot/jquery.flot.resize.min.js"></script>
<!-- FLOT PIE PLUGIN - also used to draw donut charts -->
<script src="plugins/flot/jquery.flot.pie.min.js"></script>
<!-- FLOT CATEGORIES PLUGIN - Used to draw bar charts -->
<script src="plugins/flot/jquery.flot.categories.min.js"></script>
<!-- iCheck -->
<script src="plugins/iCheck/icheck.min.js"></script>
<!-- Select2 -->
<script src="plugins/select2/select2.full.min.js"></script>
<!-- InputMask -->
<script src="plugins/input-mask/jquery.inputmask.js"></script>
<script src="plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="plugins/input-mask/jquery.inputmask.extensions.js"></script>
<!-- date-range-picker -->
<script src="plugins/daterangepicker/daterangepicker.js"></script>
<!-- bootstrap datepicker -->
<script src="plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<!-- bootstrap color picker -->
<script src="plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<!-- bootstrap time picker -->
<script src="plugins/timepicker/bootstrap-timepicker.min.js"></script>
<!-- Ion Slider -->
<script src="plugins/ionslider/ion.rangeSlider.min.js"></script>
<!-- Bootstrap slider -->
<script src="plugins/bootstrap-slider/bootstrap-slider.js"></script>
<!-- DataTables -->
<script src="plugins/datatables/jquery.dataTables.min.js"></script>
<script src="plugins/datatables/dataTables.bootstrap.min.js"></script>
<script src="plugins/bootstrap-fileinput/fileinput.js"></script>
<script src="plugins/bootstrap-fileinput/locales/zh.js"></script>

<script type="text/javascript">
	var list_ajax;
	var date_ajax;
	var search_ajax;
	//当你需要多条件查询，你可以调用此方法，动态修改参数传给服务器
	window.reloadTable = function(oTable,datePremise,premise) {
		var date = $(datePremise).val();
		var search = $(premise).val();
		var param = {
			"date" : date,
			"search" : search
		};
		oTable.settings()[0].ajax.data = param;
		oTable.ajax.reload();
	}


	//ajax table 返回信息
	function dataTableMsg(data,xhr) {
        if (xhr.status == 200){
        }else {
            if(data.code != 0 ){
                alertMsg(data.msg,"danger");
            }
        }
    }

    $.ajaxSetup ({
        cache: false //close AJAX cache
    });


</script>
</#macro>

<#macro setting>
<!-- Control Sidebar -->
		<aside class="control-sidebar control-sidebar-dark">
			<!-- Create the tabs -->
			<ul class="nav nav-tabs nav-justified control-sidebar-tabs">
				<li>
					<a href="#control-sidebar-home-tab" data-toggle="tab">
						<i class="fa fa-home"></i>
					</a>
				</li>
				<li>
					<a href="#control-sidebar-settings-tab" data-toggle="tab">
						<i class="fa fa-gears"></i>
					</a>
				</li>
			</ul>
			<!-- Tab panes -->
		</aside>
		<div class="control-sidebar-bg"></div>
	</div>	
	<div id="loading" class="loading-panel">
		<div class="box">
			<i class="fa fa-refresh fa-spin"></i> <span class="tip"> 正在加载 · · · </span>
		</div>
	</div>
	<div class="modal fade" id="smModal">
		<div class="modal-dialog modal-sm">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
						<span aria-hidden="true">×</span>
					</button>
					<h4 class="modal-title">提示</h4>
				</div>
				<div class="modal-body">
					<p>确认删除？</p>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-primary">确认</button>
				</div>
			</div>
		</div>
	</div>
	<div class="modal fade" id="lgModal">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
						<span aria-hidden="true">×</span>
					</button>
				</div>
				<div class="modal-body">
					<p>确认删除？</p>
				</div>
			</div>
		</div>
	</div>
</#macro>